<template>
	<view>
		<!-- <view :style="'height:'+statusbarH+'px'"></view> -->
		<u-navbar
			:placeholder="true"
			:title="title"
			@leftClick="leftClick"
			:autoBack="false"
			:bgColor="bgColor"
		>
		
			<view v-if="isLeftSlot" slot="left">
				<slot name="left-dom"></slot>
			</view>	
		</u-navbar>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				statusbarH: '',
			}
		},
		props: {
			title: {
				type: String,
				default: ''
			},
			isLeftSlot: {
				type: Boolean,
				default: false
			},
			bgColor: {
				type:String,
				default: '#fff'
			}
		},
		mounted() {
			uni.getSystemInfo({
					success:(e)=> {
					this.statusbarH = e.statusBarHeight;
				}
			})
		},
		methods:{
				leftClick() {
					if (!this.isLeftSlot) {
						uni.navigateBack({
							delta: 1,
						})
					}
				}
		}
	}
</script>